﻿<%@ Page Language="C#" %>
<%@ Import Namespace="RssEasy.Core" %>
<%@ Import Namespace="RssEasy.Core.GraphicsExtend" %>
<%@ Import Namespace="RssEasy.Dal" %>
<%@ Import Namespace="LocalDAL" %>
<%@ Import Namespace="LocalDAL" %>
<!DOCTYPE html>
<html>
<head>
    <%
        LocalSeoHelper seo = new LocalSeoHelper();
        seo.lanmubankuai(8);
        HttpRequestHelper req = new HttpRequestHelper().request();
    %>
    <meta charset="utf-8" />
    <title>在线二维码生成 - 中企聚易</title>
    <meta name="keywords" content="<% Response.Write(seo.keywords); %>" />
    <meta name="description" content="<% Response.Write(seo.description); %>" />
    <link href="/css/reset.css" rel="stylesheet" />
    <link href="/css/layout.css" rel="stylesheet" />
    <style type="text/css">
        #SLB-Wrapper #SLB-Contenido { padding-top: 30px !important; }
        #SLB-Wrapper #SLB-Background { top: 36px; }
    </style>
</head>
<body>
    <!--#include virtual="/inc/header.html"  -->
    <div class="banner">
        <div class="mainwrap">
            <img src="/img/article/banner.jpg" />
        </div>
    </div>
    <div sharehelper="" class="sharehelper martop15 mainwrap"></div>
    <div class="mainwrap">
        <table class="wp100">
            <tr>
                <td class="w550">
                    <form method="post">
                        <div class="tabtitle">
                            <h2>二维码名片生成</h2>
                        </div>
                        <div class="martop15">
                            <table class="wp100 cellbor">
                                <tr>
                                    <td class="w100">姓名：</td>
                                    <td>
                                        <input type="text" id="realname" name="realname" maxlength="20" class="w250" value="<% Response.Write(req["realname"]); %>" /><label for="realname"></label></td>
                                </tr>
                                <tr>
                                    <td>手机号码：</td>
                                    <td>
                                        <input type="text" id="telphone" name="telphone" allowinput="number" class="w250" maxlength="11" value="<% Response.Write(req["telphone"]); %>" /><label for="telphone"></label></td>
                                </tr>
                                <tr>
                                    <td>座机：</td>
                                    <td>
                                        <input type="text" id="zuoji" name="zuoji" class="w250" maxlength="13" value="<% Response.Write(req["zuoji"]); %>" /><label for="zuoji"></label></td>
                                </tr>
                                <tr>
                                    <td>公司名称：</td>
                                    <td>
                                        <input type="text" id="gongsi" name="gongsi" class="w250" maxlength="25" value="<% Response.Write(req["gongsi"]); %>" /><label for="gongsi"></label></td>
                                </tr>
                                <tr>
                                    <td>公司地址：</td>
                                    <td>
                                        <input type="text" id="dizhi" name="dizhi" class="w250" maxlength="50" value="<% Response.Write(req["dizhi"]); %>" /><label for="dizhi"></label></td>
                                </tr>
                                <tr>
                                    <td>部门：</td>
                                    <td>
                                        <input type="text" id="bumen" name="bumen" class="w250" maxlength="10" value="<% Response.Write(req["bumen"]); %>" /><label for="bumen"></label></td>
                                </tr>
                                <tr>
                                    <td>职务：</td>
                                    <td>
                                        <input type="text" id="zhiwu" name="zhiwu" class="w250" maxlength="10" value="<% Response.Write(req["zhiwu"]); %>" /><label for="zhiwu"></label></td>
                                </tr>
                                <tr>
                                    <td>公司网站：</td>
                                    <td>
                                        <input type="text" id="url" name="url" class="w250" value="<% Response.Write(req["url"]); %>" /><label for="url"></label></td>
                                </tr>
                            </table>
                            <input type="hidden" name="action" value="vcard" />
                            <button type="submit" id="vcardbtn" class="btnface martop15">确认生成</button>
                        </div>
                    </form>
                </td>
                <td class="w50"></td>
                <td>
                    <form method="post">
                        <div class="tabtitle">
                            <h2>二维码文本生成</h2>
                        </div>
                        <div class="martop15">
                            <textarea id="neirong" name="neirong" class="wp100 h280"><% Response.Write(req["neirong"]); %></textarea>
                            <div class="martop10">最多支持1000个字符，500个汉字，超出部份自动截断</div>
                            <input type="hidden" name="action" value="text" />
                            <button type="submit" class="btnface martop15">确认生成</button>
                        </div>
                    </form>
                </td>
            </tr>
        </table>
        <div class="martop15">
            <%
                switch (req["action"])
                {
                    case "text":
                        QRCodeTextList text = new QRCodeTextList();
                        req.keyvalue("neirong", StringExtend.Substring(req["neirong"], 1000));
                        text.timestamp().keyvalue("neirong", req["neirong"]).keyvalue("icourl", QRCodeHelper.create(req["neirong"]));
                        text.append().submit();
                        Response.Write("<img id='erweima' src='http://uf.rsseasy.com/" + text["icourl"] + ".jpg' lightbox='lightbox' />");
                        break;
                    case "vcard":
                        VCardExtend vcard = new VCardExtend();
                        vcard.xingming = req["realname"];
                        vcard.telphone = req["telphone"];
                        vcard.worktelphone = req["zuoji"];
                        vcard.bumen = req["bumen"];
                        vcard.zhiwu = req["zhiwu"];
                        vcard.email = req["email"];
                        vcard.url = req["url"];
                        vcard.gongsi = req["gongsi"];
                        vcard.dizhi = req["dizhi"];

                        QRCodeVcardList entity = new QRCodeVcardList();
                        entity.keyvalue(req).remove("action").timestamp().keyvalue("url", req["url"].Replace("http://", "")).keyvalue("icourl", QRCodeHelper.create(vcard.getContent()));
                        entity.append().submit();
                        Response.Write("<img id='erweima' src='http://uf.rsseasy.com/" + entity["icourl"] + ".jpg' lightbox='lightbox' />");
                        break;
                }
            %>
        </div>
    </div>
    <!--#include virtual="/inc/footer.html"  -->
    <!--#include virtual="/inc/js.html"  -->
    <script src="/qrcode/index.js"></script>
    <!--#include virtual="/inc/tongji.html" -->
</body>
</html>

